import 'package:wanxiang_app/generated/json/base/json_field.dart';
import 'package:wanxiang_app/generated/json/news_entity.g.dart';
import 'dart:convert';
export 'package:wanxiang_app/generated/json/news_entity.g.dart';

@JsonSerializable()
class NewsEntity {
	late int code;
	late String msg;
	late String count;
	late List<NewsData> data;

	NewsEntity();

	factory NewsEntity.fromJson(Map<String, dynamic> json) => $NewsEntityFromJson(json);

	Map<String, dynamic> toJson() => $NewsEntityToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class NewsData {
	late int id;
	late String title;
	late String content;
	late int type;
	@JSONField(name: "add_time")
	late String addTime;
	@JSONField(name: "update_time")
	late String updateTime;
	@JSONField(name: "sort_id")
	late int sortId;
	@JSONField(name: "look_num")
	late int lookNum;
	@JSONField(name: "user_name")
	late String userName;
	late String platform;
	late String introduce;
	@JSONField(name: "img_url")
	late String imgUrl;

	NewsData();

	factory NewsData.fromJson(Map<String, dynamic> json) => $NewsDataFromJson(json);

	Map<String, dynamic> toJson() => $NewsDataToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}